package day15;

public class Demo {
    public static void main(String[] args) {
        String str = "12345";
        int num1 = Integer.parseInt(str);
        Integer num2 = Integer.valueOf(str);
        System.out.println("num1: " + num1);
        System.out.println("num2: " + num2);

        str = "12a34";
        try {
            num1 = Integer.parseInt(str);
        } catch (NumberFormatException e) {
            System.out.println("num1: " + e.getMessage());
        }
//        num2 = Integer.valueOf(str);
//        System.out.println("num2: " + num2);

    }
}
